package com.yzd.learnjava.generics;

public class Holder2 {
	private Object object;
	public Holder2(Object obj) {
		this.object = obj;
	}
	
	public void set(Object obj) {
		this.object = obj;
	}
	
	public Object get() {
		return object;
	}
	
	
	public static void main(String[] args) {
		Holder2 h2 = new Holder2(new AutoMobile());
		AutoMobile a = (AutoMobile)h2.get();
		
		h2.set("Not an Automobile");
		String s = (String)h2.get();
		
		h2.set(1);
		Integer x = (Integer)h2.get();
	}
	
}
